|
|
@@ -108,25 +108,25 @@ module Agents
|
108
|
108
|
end
|
109
|
109
|
end
|
110
|
110
|
|
111
|
|
-end
|
|
111
|
+ # Clock that cannot be set and represents monotonic time since
|
|
112
|
+ # some unspecified starting point.
|
|
113
|
+ #
|
|
114
|
+ # @!visibility private
|
|
115
|
+ GLOBAL_MONOTONIC_CLOCK = class_definition.new
|
|
116
|
+ private_constant :GLOBAL_MONOTONIC_CLOCK
|
|
117
|
+
|
|
118
|
+ # @!macro [attach] monotonic_get_time
|
|
119
|
+ #
|
|
120
|
+ # Returns the current time a tracked by the application monotonic clock.
|
|
121
|
+ #
|
|
122
|
+ # @return [Float] The current monotonic time when `since` not given else
|
|
123
|
+ # the elapsed monotonic time between `since` and the current time
|
|
124
|
+ #
|
|
125
|
+ # @!macro monotonic_clock_warning
|
|
126
|
+ def monotonic_time
|
|
127
|
+ GLOBAL_MONOTONIC_CLOCK.get_time
|
|
128
|
+ end
|
112
|
129
|
|
113
|
|
-# Clock that cannot be set and represents monotonic time since
|
114
|
|
- # some unspecified starting point.
|
115
|
|
- #
|
116
|
|
- # @!visibility private
|
117
|
|
- GLOBAL_MONOTONIC_CLOCK = class_definition.new
|
118
|
|
- private_constant :GLOBAL_MONOTONIC_CLOCK
|
119
|
|
-
|
120
|
|
- # @!macro [attach] monotonic_get_time
|
121
|
|
- #
|
122
|
|
- # Returns the current time a tracked by the application monotonic clock.
|
123
|
|
- #
|
124
|
|
- # @return [Float] The current monotonic time when `since` not given else
|
125
|
|
- # the elapsed monotonic time between `since` and the current time
|
126
|
|
- #
|
127
|
|
- # @!macro monotonic_clock_warning
|
128
|
|
- def monotonic_time
|
129
|
|
- GLOBAL_MONOTONIC_CLOCK.get_time
|
130
|
|
- end
|
|
130
|
+ module_function :monotonic_time
|
131
|
131
|
|
132
|
|
- module_function :monotonic_time
|
|
132
|
+end
|